﻿<%@ Page Title="广告图片" Language="C#" MasterPageFile="~/Admin/Master/Admin.Master"
    AutoEventWireup="true" CodeBehind="AdContentSet.aspx.cs" Inherits="Besture.UI.Admin.Content.AdContentSet" %>

<%@ Register Src="/Admin/Control/UploadSinglePhoto.ascx" TagName="UploadSinglePhoto"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <script src="/ueditor/ueditor.config.js" type="text/javascript"></script>
    <script src="/ueditor/ueditor.all.js" type="text/javascript"></script>
    <link href="/ueditor/themes/default/css/ueditor.css" rel="stylesheet" type="text/css" />
    <script src="/Js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="mainbox">
        <div>
            <div>
                <table width="98%" cellspacing="0" cellpadding="0" class="table_form">
                    <tr>
                        <th>
                            名称：
                        </th>
                        <td>
                            <img src="/admin/images/indispensable.gif" align="absMiddle" /><asp:TextBox ID="AdName"
                                runat="server" MaxLength="30" class="input-text required" Width="300"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            所属类别：
                        </th>
                        <td>
                            <img src="/admin/images/indispensable.gif" align="absMiddle" /><asp:DropDownList
                                runat="server" ID="AdClassID" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            图片：
                        </th>
                        <td>
                            <img src="/admin/images/indispensable.gif" align="absMiddle" style="float: left;" />
                            <uc1:UploadSinglePhoto ID="UploadSinglePhoto1" runat="server" FolderPath="/Upload/AdPhoto/Normal/"
                                NeedThumbnail="True" ThumbnailFolderPath="/Upload/AdPhoto/Thumbnail/" Required="False" ThumbnailWidth="200"
                                ThumbnailHeight="100" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            链接地址：
                        </th>
                        <td>
                            <img src="/admin/images/dispensable.png" align="absMiddle" /><asp:TextBox ID="AdUrl"
                                runat="server" Width="300" MaxLength="200" class="input-text"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            排序：
                        </th>
                        <td>
                            <img src="/admin/images/indispensable.gif" align="absMiddle" /><asp:TextBox ID="sortID"
                                runat="server" MaxLength="5" class="input-text required number"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            内容：
                        </th>
                        <td>
                            <script type="text/plain" id="editorValue">
                                <%=_txtNContentValue%>
                            </script>
                            <div name="editorValue" id="editorValueDiv" style="width: 700px; height: auto;">
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="buttonDiv">
                <asp:Button runat="server" ID="btnSubmit" CssClass="button" Text="保存" OnClick="btnSubmit_Click" />
                <input type="button" class="button" value="取消" onclick="location.href='AdContentList.aspx'" />
            </div>
        </div>
    </div>
    <input type="hidden" id="hidEditID" runat="server" />
    <script language="javascript" type="text/javascript">
        //上传图片提示
        $(document).ready(function () {
            $('#<%=AdClassID.ClientID %>').change(function () {
                var id = $(this).val();
                $.ajax({
                    type: "GET",
                    url: "/Admin/Common/GetAdClassRemarks.aspx?id=" + id,
                    success: function (msg) {
                        $("#tipsSpan").html("※" + msg);
                    }
                });
            });

            var selectval = $('#<%=AdClassID.ClientID %>').val();
            if (selectval != "") {
                $.ajax({
                    type: "GET",
                    url: "/Admin/Common/GetAdClassRemarks.aspx?id=" + selectval,
                    success: function (msg) {
                        $("#tipsSpan").html("※" + msg);
                    }
                });
            }
        })

    </script>
    <script type="text/javascript">
        var editor = new baidu.editor.ui.Editor({//实例化编辑器
            UEDITOR_HOME_URL: '/ueditor/',
            iframeCssUrl: '/ueditor/themes/default/iframe.css',
            autoClearinitialContent: false,
            textarea: 'editorcontent'
        });
        editor.render('editorValue'); //将编译器渲染到容器
        //非空验证
        function editorHasContents() {
            var flag = editor.hasContents();
            if (!flag) {
                alert("请输入推送内容！");
            }
            return flag;
        }
    </script>
</asp:Content>
